package com.zhou.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhou.entity.QuesCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * <p>
 * 题目分类表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2023-03-02
 */
@Repository
public interface QuesCategoryMapper extends BaseMapper<QuesCategory> {

    Map<String,Object> selectMapById(int id);

    int deleteByName(String category_name);
    int deleteByReId(int repo_id);
    int deleteByReIdAndName(int repo_id, String category_name);
    int deleteByIdAndNameAndReId(int category_id, String category_name,int repo_id);
    /**
     * 通过题目类型名称来查询题目分类信息并分页
     * @param page MyBatis-Plus所提供的分页对象，必须位于第一个参数位置
     * @param category_name
     * @return
     */
    Page<QuesCategory> selectPageVo(@Param("page") Page<QuesCategory> page, @Param("category_name") String category_name);

}
